//
//  ByProductSkuSelectView.m
//  hutouben_ios
//
//  Created by pro on 16/11/30.
//  Copyright © 2016年 mc. All rights reserved.
//

#import "ByProductSkuSelectView.h"

@implementation ByProductSkuSelectView
- (instancetype)initWithFrame:(CGRect)frame{
    
    
    self = [super initWithFrame:frame];
    if (self) {
        
        _labelSort = [[UILabel alloc] init];
        _labelSort.font  = FONT(14);
        _labelSort.textColor = [UIColor darkGrayColor];
        _labelSort.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
        _labelSort.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_labelSort];
        
    }
    return self;
}

// 根据collectionCell的状态改变背景颜色
- (void)showSelectCollectionRow:(SkuCellSelectModel *)selectModel{
    
    UIColor *color;
    UIColor *textColor;
    
    // 不可选择状态颜色
    if(self.userInteractionEnabled == NO ) {
        // 不可选状态
        color = [UIColor colorWithWhite:0.95 alpha:1];
        textColor = [UIColor colorWithWhite:0.85 alpha:1];
    } else {
        // 选中状态
        if(selectModel.selectRow == self.tag) {
            color = HTB_THEME_COLOR;
            textColor = [UIColor whiteColor];
        } else {
            //正常状态
            color = [UIColor colorWithWhite:0.95 alpha:1];
            textColor = [UIColor darkGrayColor];
        }
        
    }
    
    self.labelSort.backgroundColor = color;
    self.labelSort.textColor = textColor;
    
}


@end
